.class public Lnbisdk/fm;
.super Ljava/lang/Object;


# instance fields
.field hV:[Lnbisdk/am;

.field hW:[[B

.field hX:I


# direct methods
.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method constructor <init>([I[Lnbisdk/pe;)V
    .locals 10
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lnbisdk/rp;,
            Lnbisdk/rt;
        }
    .end annotation

    const/4 v9, 0x1

    const/4 v8, 0x0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v1, Ljava/util/Stack;

    invoke-direct {v1}, Ljava/util/Stack;-><init>()V

    array-length v0, p1

    new-array v0, v0, [Lnbisdk/am;

    iput-object v0, p0, Lnbisdk/fm;->hV:[Lnbisdk/am;

    move v2, v8

    move v0, v8

    :goto_0
    iget-object v3, p0, Lnbisdk/fm;->hV:[Lnbisdk/am;

    array-length v3, v3

    if-ge v2, v3, :cond_6

    aget v3, p1, v2

    and-int/lit8 v3, v3, 0x2

    if-eqz v3, :cond_0

    move v3, v9

    :goto_1
    aget v4, p1, v2

    and-int/lit8 v4, v4, 0x1

    if-eqz v4, :cond_1

    move v4, v9

    :goto_2
    aget-object v5, p2, v2

    iget-object v6, p0, Lnbisdk/fm;->hV:[Lnbisdk/am;

    new-instance v7, Lnbisdk/am;

    invoke-direct {v7, p0, v5, v2}, Lnbisdk/am;-><init>(Lnbisdk/fm;Lnbisdk/pe;I)V

    aput-object v7, v6, v2

    if-eqz v0, :cond_4

    invoke-virtual {v1}, Ljava/util/Stack;->empty()Z

    move-result v0

    if-eqz v0, :cond_2

    new-instance v0, Lnbisdk/ih;

    invoke-direct {v0}, Lnbisdk/ih;-><init>()V

    throw v0

    :cond_0
    move v3, v8

    goto :goto_1

    :cond_1
    move v4, v8

    goto :goto_2

    :cond_2
    invoke-virtual {v1}, Ljava/util/Stack;->pop()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lnbisdk/am;

    iput v2, v0, Lnbisdk/am;->aJ:I

    iget v0, v0, Lnbisdk/am;->aK:I

    iput v0, v7, Lnbisdk/am;->aK:I

    move v0, v8

    :goto_3
    if-eqz v3, :cond_3

    move v0, v9

    :cond_3
    if-eqz v4, :cond_5

    const/4 v3, -0x1

    iput v3, v7, Lnbisdk/am;->aJ:I

    :goto_4
    iget v3, p0, Lnbisdk/fm;->hX:I

    iput v3, v7, Lnbisdk/am;->aL:I

    iget v3, p0, Lnbisdk/fm;->hX:I

    invoke-virtual {v7}, Lnbisdk/am;->ab()I

    move-result v4

    add-int/2addr v3, v4

    iput v3, p0, Lnbisdk/fm;->hX:I

    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    :cond_4
    sub-int v5, v2, v9

    iput v5, v7, Lnbisdk/am;->aK:I

    goto :goto_3

    :cond_5
    invoke-virtual {v1, v7}, Ljava/util/Stack;->push(Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_4

    :cond_6
    invoke-virtual {v1}, Ljava/util/Stack;->empty()Z

    move-result v0

    if-nez v0, :cond_7

    new-instance v0, Lnbisdk/ih;

    invoke-direct {v0}, Lnbisdk/ih;-><init>()V

    throw v0

    :cond_7
    return-void
.end method

.method private static a(Lnbisdk/ou;)Ljava/util/Vector;
    .locals 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lnbisdk/rp;
        }
    .end annotation

    new-instance v0, Ljava/util/Vector;

    invoke-direct {v0}, Ljava/util/Vector;-><init>()V

    const-wide/16 v1, 0x0

    :goto_0
    const/4 v3, 0x4

    :try_start_0
    invoke-virtual {p0, v3}, Lnbisdk/ou;->bd(I)J

    move-result-wide v3

    invoke-static {v1, v2, p0, v3, v4}, Lnbisdk/fm;->a(JLnbisdk/ou;J)Lnbisdk/pe;

    move-result-object v3

    invoke-virtual {v0, v3}, Ljava/util/Vector;->addElement(Ljava/lang/Object;)V
    :try_end_0
    .catch Lnbisdk/bh; {:try_start_0 .. :try_end_0} :catch_0

    const-wide/16 v3, 0x1

    add-long/2addr v1, v3

    goto :goto_0

    :catch_0
    move-exception v1

    invoke-virtual {v0}, Ljava/util/Vector;->trimToSize()V

    return-object v0
.end method

.method public static a(Ljava/io/InputStream;)Lnbisdk/jz;
    .locals 9

    new-instance v0, Lnbisdk/lo;

    invoke-direct {v0, p0}, Lnbisdk/lo;-><init>(Ljava/io/InputStream;)V

    new-instance v1, Lnbisdk/ay;

    invoke-direct {v1, v0}, Lnbisdk/ay;-><init>(Lnbisdk/ou;)V

    const/16 v0, 0x14

    :try_start_0
    invoke-virtual {v1, v0}, Lnbisdk/ou;->bc(I)[B

    move-result-object v0

    new-instance v2, Ljava/util/Hashtable;

    invoke-direct {v2}, Ljava/util/Hashtable;-><init>()V

    const/4 v3, 0x4

    invoke-virtual {v1, v3}, Lnbisdk/ou;->bd(I)J

    move-result-wide v3

    const-wide/16 v5, 0x0

    :goto_0
    cmp-long v7, v5, v3

    if-gez v7, :cond_0

    invoke-virtual {v1}, Lnbisdk/ou;->jS()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v1}, Lnbisdk/ou;->jS()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v2, v7, v8}, Ljava/util/Hashtable;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-wide/16 v7, 0x1

    add-long/2addr v5, v7

    goto :goto_0

    :cond_0
    invoke-static {v1}, Lnbisdk/fm;->a(Lnbisdk/ou;)Ljava/util/Vector;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-object v3

    :try_start_1
    invoke-virtual {v1}, Lnbisdk/ou;->close()V
    :try_end_1
    .catch Lnbisdk/rp; {:try_start_1 .. :try_end_1} :catch_0

    new-instance v1, Lnbisdk/jz;

    invoke-direct {v1, v0, v2, v3}, Lnbisdk/jz;-><init>([BLjava/util/Hashtable;Ljava/util/Vector;)V

    return-object v1

    :catchall_0
    move-exception v0

    :try_start_2
    invoke-virtual {v1}, Lnbisdk/ou;->close()V

    throw v0
    :try_end_2
    .catch Lnbisdk/rp; {:try_start_2 .. :try_end_2} :catch_0

    :catch_0
    move-exception v0

    new-instance v1, Ljava/lang/IllegalArgumentException;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "malformed template library: "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v1
.end method

.method private static a(JLnbisdk/ou;J)Lnbisdk/pe;
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lnbisdk/rp;
        }
    .end annotation

    new-instance v0, Lnbisdk/fb;

    long-to-int v1, p3

    invoke-direct {v0, p2, v1}, Lnbisdk/fb;-><init>(Lnbisdk/ou;I)V

    invoke-virtual {v0}, Lnbisdk/fb;->jS()Ljava/lang/String;

    move-result-object v1

    new-instance v2, Ljava/util/Vector;

    invoke-direct {v2}, Ljava/util/Vector;-><init>()V

    :goto_0
    :try_start_0
    invoke-virtual {v0}, Lnbisdk/fb;->jS()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/util/Vector;->addElement(Ljava/lang/Object;)V
    :try_end_0
    .catch Lnbisdk/bh; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    invoke-virtual {v2}, Ljava/util/Vector;->trimToSize()V

    new-instance v0, Lnbisdk/pe;

    invoke-direct {v0, p0, p1, v1, v2}, Lnbisdk/pe;-><init>(JLjava/lang/String;Ljava/util/Vector;)V

    return-object v0
.end method
